﻿@{ Layout = "../Shared/_LayoutLayer.cshtml"; }

<div class="form-group">
  <label>导入类型</label>
  <div class="mt-2 ml-2">
    <div class="radio radio-primary form-check-inline">
      <input v-model="importType" type="radio" id="zip" value="zip">
      <label for="zip"> 导入压缩包 </label>
    </div>
    <div class="radio radio-primary form-check-inline">
      <input v-model="importType" type="radio" id="csv" value="csv">
      <label for="csv"> 导入Excel文件 </label>
    </div>
    <div class="radio radio-primary form-check-inline">
      <input v-model="importType" type="radio" id="txt" value="txt">
      <label for="txt"> 导入Txt文件 </label>
    </div>
  </div>
  <small v-if="importType === 'zip'" class="help-block">请选择后台导出的压缩包，系统能够将内容以及内容相关的图片、附件等文件一并导入。</small>
  <small v-if="importType === 'excel'" class="help-block">请选择Excel文件，系统将导入Excel文件对应的字段数据。</small>
  <small v-if="importType === 'txt'" class="help-block">请选择以.txt结尾的纯文本文件，文件名将作为内容标题，文件内容将作为正文导入。</small>
</div>

<div id="drop-area" style="height: 200px; line-height: 200px; text-align: center; font-size: 18px; color: #777; border: 2px dashed #0000004d; background: #eee;	border-radius: 6px; cursor: pointer; margin-bottom: 20px">
  点击批量上传文件或者将文件拖拽到此区域
</div>

<div class="row">
  <div class="col-sm-4 col-lg-3 col-xs-12" v-for="(file, index) in files">
    <div class="card m-b-20">
      <div class="card-body">
        <p class="card-text">
          {{ file.fileName }}
          <br /> 大小：{{ Math.round(file.length/1024) + ' KB' }}
        </p>
        <a v-on:click="del(file)" href="javascript:;" class="card-link text-danger">删 除</a>
      </div>
    </div>
  </div>
</div>

<div class="form-group">
  <label>
    内容状态
  </label>
  <div class="mt-2 ml-2">
    <div v-for="(level, index) in checkedLevels" class="radio radio-primary form-check-inline">
      <input :id="'level_' + index" type="radio" :value="level.key" v-model="checkedLevel">
      <label :for="'level_' + index">{{ level.value }}</label>
    </div>
  </div>
</div>

<div class="form-check checkbox checkbox-primary">
  <input class="form-check-input" type="checkbox" id="isOverride" v-model="isOverride">
  <label class="form-check-label" for="isOverride">
    覆盖同名标题
  </label>
</div>

<hr />

<div class="text-right mr-1">
  <button v-on:click="btnSubmitClick" type="button" class="btn btn-primary m-l-5">确 定</button>
  <button type="button" class="btn btn-default m-l-5" onclick="window.parent.layer.closeAll()">取 消</button>
</div>

@section Scripts{
<script type="text/javascript" src="../assets/js/web-uploader/js/Q.js"></script>
<script type="text/javascript" src="../assets/js/web-uploader/js/Q.Uploader.js"></script>
<script src="contentsLayerImport.js" type="text/javascript"></script> }